﻿using MediatR;
using Microsoft.EntityFrameworkCore;
using WebAppTemplate.CSR.Repository.Entities;

namespace WebAppTemplate.CSR.Repository.DbContexts
{
    public class AppDbContext : DbContext
    {
        public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }

        public DbSet<Demo> Demo { get; set; }
        public DbSet<DemoOneWithOne> DemoOneWithOne { get; set; }
        public DbSet<DemoOneWithMore> DemoOneWithMore { get; set; }
        public DbSet<DemoMoreWithMore> DemoMoreWithMore { get; set; }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            builder.ApplyConfigurationsFromAssembly(typeof(AppDbContext).Assembly);
        }
    }
}
